
(function($){
$.fn.selectedVal = function() {
	return $(this).selectedOption().val();
};
$.fn.isChecked = function() {
	return $(this).attr('checked');
};
$.fn.selectedOption = function() {
	return $(this).find("option:selected");
};
$.fn.selectedText = function() {
	return $(this).selectedOption().text();
};
$.fn.selectValue = function(value) {
	$(this).find("option[value="+value+"]").attr("selected", "selected");
}
$.fn.addOption = function(value, text, selected) {
	return $(this).each( function(){
		var str = "<option value='"+value+"'";
		if ( selected ){
			str += " selected='selected'";
		}
		str += ">"+text+"</option>";
		$(this).append( $(str) );
	});
};

$.fn.addOptions = function( arr ) {
	return $(this).each( function(){
		var $this = $(this);
		$.each( arr, function(v,t){
					$this.addOption(v,t);
					return true;
				} );
	});
};
$.fn.selectAll = function() {
	$(this).find("option").attr("selected","selected");
};
}(jQuery));